package com.tao.com.xiaowen.config.sqlite;

import android.content.Context;

/**
 * Created by tao on 17-3-1.
 */

public class DatabaseUtils {
    private static DataBaseHelper helper;

    private DatabaseUtils() {

    }

    /**
     * 一般来说这里的initHelper放到application中去初始化
     * 当然也可以在项目运行阶段初始化
     */
    public static void initHelper(Context context, String name) {
        if (helper == null) {
            helper = new DataBaseHelper(context, name);
        }
    }

    public static DataBaseHelper getHelper() {
        if (helper == null) {
            new RuntimeException("MyOpenHelper is null,No init it");
        }
        return helper;
    }
}
